home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 499 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.6 KB

  1. Path: engnews1.Eng.Sun.COM!taumet!clamage
  2. From: fjh@munta.cs.mu.OZ.AU (Fergus Henderson)
  3. Newsgroups: comp.std.c++
  4. Subject: Re: Exceptions and Destructors
  5. Date: 15 Feb 1996 15:42:50 GMT
  6. Organization: Comp Sci, University of Melbourne
  7. Approved: clamage@eng.sun.com (comp.std.c++)
  8. Message-ID: <4fv8kb$j1@mulga.cs.mu.OZ.AU>
  9. References: <BGLENDEN.96Feb14173755@colobus.aoc.nrao.edu>
  10. NNTP-Posting-Host: taumet.eng.sun.com
  11. Content-Type: text
  12. X-Nntp-Posting-Host: munta.cs.mu.oz.au
  13. Content-Length: 894
  14. X-Lines: 21
  15. Originator: clamage@taumet
  16.  
  17. bglenden@colobus.aoc.nrao.edu (Brian Glendenning) writes:
  18.  
  19. >As I understand it, an object is only considered constructed when its
  20. >constructor has finished, so that an exception thrown from within that
  21. >constructor will not result in that object's destructor being
  22. >called. (Its completely constructed subobjects will be however).
  23.  
  24. Right.
  25.  
  26. >What about the destructor? Is the object considered destructed when
  27. >the destructor is *entered*, or when it *completes*?
  28.  
  29. The object is considered "partially constructed" as soon as
  30. the destructor is entered.  It is not completely destructed either.
  31. If an exception is thrown in the destructor, the destructor should not
  32. be called again, but destructors for base class sub-objects should be
  33. called as part of stack unwinding.
  34.  
  35. --
  36. Fergus Henderson                 WWW: http://www.cs.mu.oz.au/~fjh
  37. fjh@cs.mu.oz.au                  PGP: finger fjh@128.250.37.3
  38.  
  39. [ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  40.   Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy is
  41.   summarized in http://reality.sgi.com/employees/austern_mti/std-c++/policy.html
  42. ]
  43.